/* 
 *
 * Copyright (C) 1999-2012 IFLYTEK Inc.All Rights Reserved. 
 * 
 * FileName：DateUtil.java
 * 
 * Description：
 * 
 * History：
 * Version   Author      Date            Operation 
 * 1.0       2016年10月17日下午4:01:19         Create   
 */
package com.buer.train.common.utils;


import com.buer.train.common.eumn.ResultEnum;

import java.io.Serializable;

/**
 * @Author: lds
 * @ClassName: BaseResult
 * @Description:
 * @Date: Created in 18:53 2017/11/23
 */
public class BaseResult implements Serializable {
    /***/
    private Integer code;
    /***/
    private String msg;
    /***/
    private Object data;

    public static BaseResult build(Integer code, String message, Object data){
        BaseResult baseResult =new BaseResult();
        baseResult.setCode(code);
        baseResult.setMsg(message);
        baseResult.setData(data);
        return baseResult;
    }

   public static BaseResult build(ResultEnum resultEnum, Object data){
        BaseResult baseResult =new BaseResult();
        baseResult.setCode(resultEnum.getCode());
        baseResult.setMsg(resultEnum.getMsg());
        baseResult.setData(data);
        return baseResult;
    }


    public static BaseResult build(ResultEnum resultEnum){
        BaseResult baseResult =new BaseResult();
        baseResult.setCode(resultEnum.getCode());
        baseResult.setMsg(resultEnum.getMsg());
        return baseResult;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
